<template>
  <div class="box">
    <img class='bg' src="../../assets/img/login/perInfo.png" alt="">
    <div class="con">
      <img class='tou' src="../../assets/img/first/conUs.png" alt="">
      <div class="name">用户13834226666</div>
      <div class="ul">
        <div class="li flex vc hb" @click="getUrl('累计记录')">
          <div class="tit shrink0">用户累计捐赠金额</div>
          <div class="right flex vc">
            <div class="text">¥{{count}}</div>
            <img class='back' src="../../assets/img/invoice/back.png" alt="">
          </div>
        </div>
        <div class="li cli1 flex vc hb" @click="getUrl('线上记录')">
          <div class="shrink0">线上捐赠</div>
          <div class="right flex vc">
            <div>¥{{count}}</div>
            <img class='back' src="../../assets/img/invoice/back.png" alt="">
          </div>
        </div>
        <div class="li cli2 flex vc hb">
          <div class="shrink0">线下捐赠</div>
          <div class="right flex vc">
            <div>¥0</div>
            <img class='back' src="../../assets/img/invoice/back.png" alt="">
          </div>
        </div>
        <div class="li flex vc hb" @click='getList'>
          <div class="shrink0">参与捐赠项目数</div>
          <div class="right flex vc">
            <div>3个</div>
            <img class='back' src="../../assets/img/invoice/back.png" alt="">
          </div>
        </div>
        <router-link :to="{path:'/donPay'}" class='submit'>在线捐赠</router-link>
      </div>
    </div>
  </div>
</template>

<script>
import { userCount } from '@/api/donate'
export default {
  data () {
    return {
      count: 0
    }
  },

  created () {
    userCount().then(response => {
      this.count = response.data
    })
  },

  methods: {
    getUrl (o) {
      this.$router.push({ path: '/donList', query: { title: o } })
    },
    getList () {
      this.$router.push('/donXm')
    }
  }
}
</script>

<style scoped="scoped">
  .box {
    font-size: 16px;
    color: #434343;
    position: relative;
  }

  .flex {
    width: auto;
  }

  .bg {
    width: 100%;
  }

  .con {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 100;
    padding: 22px 15px 0;
  }

  .tou {
    display: block;
    width: 75px;
    height: 75px;
    border-radius: 50%;
    border: 4px solid #fff;
    margin: 0 auto;
  }

  .name {
    color: #fff;
    font-size: 16px;
    text-align: center;
    padding: 15px;
  }

  .ul {
    width: 100%;
    background: #fff;
    border-radius: 10px;
    padding: 10px 20px 0;
  }

  .li {
    padding: 20px 5px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }

  .cli1 {
    padding: 25px 5px 10px;
    border: 0;
  }

  .cli2 {
    padding: 10px 5px 25px;
  }

  .li .tit {
    font-weight: bold;
  }

  .right .text {
    color: #762A2A;
  }

  .back {
    width: 8px;
    height: 16px;
    margin-left: 15px;
  }

  .submit {
    display: block;
    width: 100%;
    height: 50px;
    background: #C6AB72;
    color: #fff;
    border-radius: 100px;
    margin: 130px auto 0;
    text-align: center;
    line-height: 50px;
    font-size: 18px;
    box-shadow: 0px 8px 10px 0px rgba(0, 0, 0, 0.15);
  }
</style>
